<?php echo $this->element('menu', array("active" => "9.a"));?>
<ul class="breadcrumb">
	<li>
          <?php echo $this->Html->link(__('Contacts  ', true), array('action' => 'index'), array('class'=>'fist_link'));?>
        </li>
        <li>
          <a href="#" ><?php __('Contact') ?>  </a>
    </li>
 </ul>
<div id="content">
<div id="left" class="hight_resize" >
<?php echo $this->Html->link(__('Add Contact', true), array('action' => 'add'),array('class' => 'bt f_r m_t_15')); ?>  

<div class="table table_p_15_2 boder">
	<table width="100%"  cellpadding="0" cellspacing="0">
    <thead>
	<tr>			
			<td><?php echo $this->Paginator->sort('name');?></td>
			<td><?php echo $this->Paginator->sort('company_id');?></td>
			<td><?php echo $this->Paginator->sort('phone_number');?></td>
			<td><?php echo $this->Paginator->sort('email');?></td>
			<td></td>
	</tr>
    </thead>
    <tbody>
	<?php
	$i = 0;
	foreach ($contacts as $contact):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $contact['Contact']['name']; ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($contact['Company']['name'], array('controller' => 'companies', 'action' => 'view', $contact['Company']['id'])); ?>
		</td>
		<td><?php echo $contact['Contact']['phone_number']; ?>&nbsp;</td>
		<td><?php echo $contact['Contact']['email']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View', true), array('action' => 'view', $contact['Contact']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $contact['Contact']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $contact['Contact']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $contact['Contact']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
    </tbody>
	</table>
    <p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>	
</div>
	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
<div id="right" class="hight_resize" >
          <fieldset class="form">
            <form>
              <div class="input">
                <label class="w85">Contact name:</label>
                <input type="text" value="" class="w155"/>
                <div class="error-message">Error message will be put here</div>
              </div>
              <div class="input">
                <label class="w85">Company:</label>
                <input type="text" value="" class="w155"/>
                <div class="error-message">Error message will be put here</div>
              </div>
              <div class="input">
                <label class="w85">Email:</label>
                <input type="text" value="" class="w155"/>
                <div class="error-message">Error message will be put here</div>
              </div>
              <div class="input">
                <label class="w85">Phone:</label>
                <input type="text" value="" class="w155"/>
                <div class="error-message">Error message will be put here</div>
              </div>
              <input type="submit" value="Search" class="bt bt_search" />
            </form>
          </fieldset>
        </div>
</div>